<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加护工</title>
    <link href="__UPLOADIFY__/common.css" rel="stylesheet" type="text/css" />
    <style>
        input{
            height: 20px;
            width:150px;
            margin: 10px;
        }
        .xx{
            height: 15px;
            width: 20px;
            margin: 10px;
        }
    </style>
</head>
<body>
<h3>护工信息添加</h3>
<a href="{:U('index')}">返回列表</a>
<form action="{:U('add')}" method="post">
    *姓名：<input name="name" type="text"><br>
    *年龄：<input name="age" type="text"><br>
    *性别：<label><input class="xx" name="sex" type="radio" value="男">男</label> <label><input class="xx" name="sex" type="radio" value="女" checked="checked">女</label><br>
    *电话：<input name="phone" type="text"><br>
    *身份证号码：<input name="id_card_no" type="text"><br>
    微信：<input name="wechat" type="text"><br>
    技能：<input name="skill" type="text">（针灸 按摩···等，多项用逗号分开）<br>
    头像：<input type="hidden" name="headurl" id="logo" value="">
        <input type="file" id="logo-upload" size="35" />
        <div id="logo-preview"></div><br>
    具体服务内容：<input name="serverdetail" type="text"><br>
    服务地区(重庆地区)：<select name="server_c_are[]" multiple="multiple">
                <option>请选择...</option>
                <foreach name='c_ares' item='c_are'>
                    <option value="{$c_are.id}">{$c_are.title}</option>
                </foreach>
            </select><br>
    服务地区(三亚地区)：<select name="server_s_are[]" multiple="multiple">
                <option>请选择...</option>
                <foreach name='s_ares' item='s_are'>
                    <option value="{$s_are.id}">{$s_are.title}</option>
                </foreach>
            </select><br>
    拥有的服务类型：<foreach name="server" item="row">
                    <label><input class="xx" name="server_type_id[]" type="checkbox" value="{$row.id}" checked="checked">{$row.name}</label>
                </foreach>
    <br>
    <input type="submit" value="提交">
</form>
<script type="text/javascript" src="__JS__/jquery-1.11.2.js"></script>
<script type="text/javascript" src="__UPLOADIFY__/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="__LAYER__/layer.js"></script>
<script type="text/javascript">
    $(function () {
        $('#logo-upload').uploadify({
            'swf'      : '__UPLOADIFY__/uploadify.swf',
            'uploader' : '{:U("ajaxHeadImg")}',
            'buttonText':' 选择文件...',
            'onUploadSuccess':function(file,response){
                //是否上传成功
                var data = $.parseJSON(response);
                if(data){
                    var file_url = data.url;
//                    //将图片路径放入到隐藏域中
                    $('#logo').val(file_url);
                    $('#logo-preview').html("<img width='100px' src='"+file_url+"'>");
                    layer.msg(data.msg, {icon: 6});
                }else {
                    layer.msg(data.msg, {icon: 5});
                }
            }
        });
    });
</script>
</body>
</html>